<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/view/common/header-talent.jspf"%>

<!-- 注册失败后的页面显示 -->
		<c:if test="${!empty requestScope.talent }">
			<div class="alert alert-danger alert-dismissible fade in" role="alert" style="text-align: center;">
		       <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>
		       <strong>求职者注册失败！</strong>
			</div>
		</c:if>
	<center>
		<h1>新增简历页面</h1>
	</center>
	<div class="container">
	<form class="form-horizontal" role="form"
		action="<%=request.getContextPath()%>/ResumeServlet?command=addResume" method="post" onsubmit="return validate();">
		<div class="form-group">
		<label for="name" class="col-sm-2 control-label" style="margin-left:-100px;">求职意向</label>
			<div class="col-sm-12">
				<input type="text" class="form-control" name="intention" id="intention"  value="${resume.intention }">
			</div>
		<span id="codeInfo" class="bg-danger text-muted"></span>
		</div>
		<div class="form-group">
		<label for="name" class="col-sm-2 control-label" style="margin-left:-100px;">工作经历</label>			
		<textarea rows="3" class="form-control"  name="workExperience" id="workExperience">${resume.workExperience }</textarea>
		<span id="pwdInfo" class="bg-danger text-muted"></span>
		</div>
		<div class="form-group">
		<label for="name" class="col-sm-2 control-label" style="margin-left:-100px;">项目经历</label>
		<textarea rows="3" class="form-control"  name="projectExperience" id="projectExperience">${resume.projectExperience }</textarea>
			<span id="nameInfo" class="bg-danger text-muted"></span>
		</div>
		<div class="form-group">
			<div class="col-sm-offset-2 col-sm-10">
				<button type="submit" class="btn btn-default">新增</button>
				 <input type="button" class="btn btn-primary" onclick="javascript:history.back();" value="返回"/>
			</div>
		</div>
	</form>
	</div>
	<script>
			/**
			 * 表单验证
			 */
			function validate() {
				var result = true;
				var intention = document.getElementById("intention");
				var workExperience = document.getElementById("workExperience");
				var projectExperience = document.getElementById("projectExperience");
				if(intention.value == ''){
					document.getElementById("codeInfo").innerHTML="求职意向不能为空";
					result = false;
				}else{
					document.getElementById("codeInfo").innerHTML="";
				}
				if(workExperience.value == ''){
					document.getElementById("pwdInfo").innerHTML="工作经验不能为空";
					result = false;
				}else{
					document.getElementById("pwdInfo").innerHTML="";
				}
				if(projectExperience.value == ''){
					document.getElementById("nameInfo").innerHTML="项目经历不能为空";
					result = false;
				}else{
					document.getElementById("nameInfo").innerHTML="";
				}
				
				return result;
			}
			if('${result}' === '0'){
				layer.msg('新增失败',{icon:0});
			}
		
		</script>
</body>
<link rel="shortcut icon" href="<%=request.getContextPath()%>/static/common/img/favicon.ico"/>
</html>